package com.recommend.recommendkeyword.mapper;

import com.recommend.recommendkeyword.entity.User;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface UserMapper {
    /**
     * 注册
     */
    public Integer insertUser(User user);
    /**
     * 查询是否已存在对应的User
     */
    public User selectUserByUsername(String username);
    /**
     * 根据username和password来查询User
     */
    public User selectUserByUsernameAndPassword(String username,String password);
    /**
     * 根据userId来查询User
     */
    public User selectUserById(int userId);
    /**
     * 根据userId和password来查询User
     */
    public User selectUserByIdAndPassword(int userId,String password);
    /**
     * 根据userId修改password
     */
    public Integer changePasswordByUserId(int userId,String password);
    /**
     * 根据userId修改vip权限
     */
    public Integer changeVipByuUserId(int userId,int vip);
    /**
     * 修改User的信息
     */
    public Integer changeUser(int userId,String username,String email);

    /**
     * 增加搜索次数
     */
    void addSearchNum(int userId);

    String getNameById(int userId);
}
